using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class PKT_VendBalancesMap : EntityTypeConfiguration<PKT_VendBalances>
    {
        public PKT_VendBalancesMap()
        {
            // Primary Key
            this.HasKey(t => new { t.spid, t.id });

            // Properties
            this.Property(t => t.spid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.VendID)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("PKT_VendBalances");
            this.Property(t => t.spid).HasColumnName("spid");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.VendID).HasColumnName("VendID");
            this.Property(t => t.MasterID).HasColumnName("MasterID");
            this.Property(t => t.CstCtrID).HasColumnName("CstCtrID");
            this.Property(t => t.OpeningBase1).HasColumnName("OpeningBase1");
            this.Property(t => t.OpeningBase2).HasColumnName("OpeningBase2");
            this.Property(t => t.OpeningAcct).HasColumnName("OpeningAcct");
            this.Property(t => t.MovementAcct).HasColumnName("MovementAcct");
            this.Property(t => t.MovementBase1).HasColumnName("MovementBase1");
            this.Property(t => t.MovementBase2).HasColumnName("MovementBase2");
            this.Property(t => t.BalanceAcct).HasColumnName("BalanceAcct");
            this.Property(t => t.BalanceBase1).HasColumnName("BalanceBase1");
            this.Property(t => t.BalanceBase2).HasColumnName("BalanceBase2");
        }
    }
}
